package com.example.badminton.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.badminton.entity.Banner;
import com.example.badminton.mapper.BannerMapper;
import com.example.badminton.service.BannerService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BannerServiceImpl extends ServiceImpl<BannerMapper, Banner> implements BannerService {
    
    @Override
    public List<Banner> getActiveBanners() {
        QueryWrapper<Banner> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("status", 1); // 只查询启用的轮播图
        queryWrapper.orderByAsc("sort"); // 按排序升序
        return list(queryWrapper);
    }
} 